﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.SqlClient;
using System.Data;
using WebApplication1.DAO.Helper;
using System.Collections;

namespace WebApplication1.DAO
{
    public class db
    {
        /// <summary>
        /// 获取显示数据
        /// </summary>
        /// <returns></returns>
        public Dictionary<string, List<string>> GetValueInfo()
        {
            string sql = "select * from visualization";
            SqlDataReader objReader = SQLHelper.GetReader(sql);
            Dictionary<string, List<string>> valueInfo = new Dictionary<string, List<string>>();
            List<string> id = new List<string>();
            List<string> name = new List<string>();
            List<string> value = new List<string>();
            List<string> meas = new List<string>();
            while (objReader.Read())
            {
                //id.Add(Convert.ToInt32(objReader["visId"]));
                id.Add(objReader["visId"].ToString());
                name.Add(objReader["visName"].ToString());
                //value.Add(Convert.ToInt32(objReader["visValue"]));
                value.Add(objReader["visValue"].ToString());
                meas.Add(objReader["visMeasure"].ToString());
            }
            objReader.Close();
            valueInfo.Add("id", id);
            valueInfo.Add("name", name);
            valueInfo.Add("value", value);
            valueInfo.Add("meas", meas);
            return valueInfo;
        }
    }
}